﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IResolver.cs" company="Rolosoft Ltd">
//   © Rolosoft Ltd
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

#region License

// Copyright 2013 Rolosoft Ltd
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

namespace Rsft.Net.Dns.Interfaces
{
    #region Usings

    using System;
    using System.Diagnostics.Contracts;
    using System.Net;

    using Rsft.Net.Dns.Entities;

    #endregion

    /// <summary>
    ///     The Resolver interface.
    /// </summary>
    [ContractClass(typeof(ResolverContracts))]
    public interface IResolver
    {
        #region Public Events

        /// <summary>
        ///     The verbose event.
        /// </summary>
        event EventHandler<VerboseEventArgs> VerboseEvent;

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the configuration.
        /// </summary>
        /// <value>
        /// The configuration.
        /// </value>
        IConfiguration Configuration { get; set; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// Asynchronously returns the Internet Protocol (IP) addresses for the specified host.
        /// </summary>
        /// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
        /// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// An <see cref="T:System.IAsyncResult" /> instance that references the asynchronous request.
        /// </returns>
        /// <exception cref="T:System.ArgumentNullException"><paramref name="hostNameOrAddress" /> is null.</exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="hostNameOrAddress" /> is greater than 126 characters.</exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">An error is encountered when resolving <paramref name="hostNameOrAddress" />.</exception>
        /// <exception cref="T:System.ArgumentException"><paramref name="hostNameOrAddress" /> is an invalid IP address.</exception>
        IAsyncResult BeginGetHostAddresses(string hostNameOrAddress, AsyncCallback requestCallback, object value);

        /// <summary>
        /// The begin get host by address.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="state">The state.</param>
        /// <returns>
        /// The <see cref="IAsyncResult" />.
        /// </returns>
        IAsyncResult BeginGetHostByAddress(string address, AsyncCallback asyncCallback, object state);

        /// <summary>
        /// The begin get host by address.
        /// </summary>
        /// <param name="address">
        /// The address.
        /// </param>
        /// <param name="asyncCallback">
        /// The async callback.
        /// </param>
        /// <param name="state">
        /// The state.
        /// </param>
        /// <returns>
        /// The <see cref="IAsyncResult"/>.
        /// </returns>
        IAsyncResult BeginGetHostByAddress(IPAddress address, AsyncCallback asyncCallback, object state);

        /// <summary>
        /// Begins an asynchronous request for <see cref="T:System.Net.IPHostEntry" /> information about the specified DNS host name.
        /// </summary>
        /// <param name="hostName">The DNS name of the host.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// An <see cref="T:System.IAsyncResult" /> instance that references the asynchronous request.
        /// </returns>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        ///   <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
        ///   <IPermission class="System.Net.DnsPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        ///   </PermissionSet>
        /// <exception cref="T:System.ArgumentNullException"><paramref name="hostName" /> is null.</exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">An error was encountered executing the DNS query.</exception>
        [Obsolete("BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
        IAsyncResult BeginGetHostByName(string hostName, AsyncCallback asyncCallback, object value);

        /// <summary>
        /// Asynchronously resolves a host name or IP address to an <see cref="T:System.Net.IPHostEntry" /> instance.
        /// </summary>
        /// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// An <see cref="T:System.IAsyncResult" /> instance that references the asynchronous request.
        /// </returns>
        /// <exception cref="T:System.ArgumentNullException"><paramref name="hostNameOrAddress" /> is null.</exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="hostNameOrAddress" /> is greater than 126 characters.</exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">An error is encountered when resolving <paramref name="hostNameOrAddress" />.</exception>
        /// <exception cref="T:System.ArgumentException"><paramref name="hostNameOrAddress" /> is an invalid IP address.</exception>
        IAsyncResult BeginGetHostEntry(string hostNameOrAddress, AsyncCallback asyncCallback, object value);

        /// <summary>
        /// Asynchronously resolves an IP address to an <see cref="T:System.Net.IPHostEntry" /> instance.
        /// </summary>
        /// <param name="address">The IP address to resolve.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// An <see cref="T:System.IAsyncResult" /> instance that references the asynchronous request.
        /// </returns>
        /// <exception cref="T:System.ArgumentNullException"><paramref name="address" /> is null.</exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">An error is encountered when resolving <paramref name="address" />.</exception>
        /// <exception cref="T:System.ArgumentException"><paramref name="address" /> is an invalid IP address.</exception>
        IAsyncResult BeginGetHostEntry(IPAddress address, AsyncCallback asyncCallback, object value);

        /// <summary>
        /// Begins the query.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="queryType">Type of the query.</param>
        /// <param name="queryClassType">Type of the query class.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="state">The state.</param>
        /// <returns>
        /// The <see cref="IAsyncResult" />.
        /// </returns>
        IAsyncResult BeginQuery(
            string name, QType queryType, QClassType queryClassType, AsyncCallback asyncCallback, object state);

        /// <summary>
        /// Begins an asynchronous request to resolve a DNS host name or IP address to an <see cref="T:System.Net.IPAddress" /> instance.
        /// </summary>
        /// <param name="hostName">The DNS name of the host.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// An <see cref="T:System.IAsyncResult" /> instance that references the asynchronous request.
        /// </returns>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        ///   <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
        ///   <IPermission class="System.Net.DnsPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        ///   </PermissionSet>
        /// <exception cref="T:System.ArgumentNullException"><paramref name="hostName" /> is null.</exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">The caller does not have permission to access DNS information.</exception>
        [Obsolete("BeginResolve is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
        IAsyncResult BeginResolve(string hostName, AsyncCallback asyncCallback, object value);

        /// <summary>
        /// Ends an asynchronous request for DNS information.
        /// </summary>
        /// <returns>
        /// An array of type <see cref="T:System.Net.IPAddress"/> that holds the IP addresses for the host specified by the
        ///     <paramref name="hostNameOrAddress"/>
        ///     parameter of
        ///     <see cref="M:Rsft.Net.Dns.BeginGetHostAddresses(System.String,System.AsyncCallback,System.Object)"/>
        ///     .
        /// </returns>
        /// <param name="asyncResult">
        /// An <see cref="T:System.IAsyncResult"/> instance returned by a call to the
        ///     <see cref="M:Rsft.Net.Dns.BeginGetHostAddresses(System.String,System.AsyncCallback,System.Object)"/>
        ///     method.
        /// </param>
        IPAddress[] EndGetHostAddresses(IAsyncResult asyncResult);

        /// <summary>
        /// The end get host by address.
        /// </summary>
        /// <param name="asyncResult">
        /// The async result.
        /// </param>
        /// <returns>
        /// The <see cref="IPHostEntry"/>.
        /// </returns>
        IPHostEntry EndGetHostByAddress(IAsyncResult asyncResult);

        /// <summary>
        /// The end get host by name.
        /// </summary>
        /// <param name="asyncResult">
        /// The async result.
        /// </param>
        /// <returns>
        /// The <see cref="IPHostEntry"/>.
        /// </returns>
        IPHostEntry EndGetHostByName(IAsyncResult asyncResult);

        /// <summary>
        /// Ends an asynchronous request for DNS information.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Net.IPHostEntry"/> instance that contains address information about the host.
        /// </returns>
        /// <param name="asyncResult">
        /// An <see cref="T:System.IAsyncResult"/> instance returned by a call to an
        ///     <see cref="Overload:Rsft.Net.Dns.BeginGetHostEntry"/>
        ///     method.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="asyncResult"/> is null.
        /// </exception>
        IPHostEntry EndGetHostEntry(IAsyncResult asyncResult);

        /// <summary>
        /// The end query.
        /// </summary>
        /// <param name="asyncResult">
        /// The async result.
        /// </param>
        /// <returns>
        /// The <see cref="Response"/>.
        /// </returns>
        Response EndQuery(IAsyncResult asyncResult);

        /// <summary>
        /// Ends an asynchronous request for DNS information.
        /// 
        /// </summary>
        /// 
        /// <returns>
        /// An <see cref="T:System.Net.IPHostEntry"/> object that contains DNS information about a host.
        /// 
        /// </returns>
        /// <param name="asyncResult">An <see cref="T:System.IAsyncResult"/> instance that is returned by a call to the <see cref="M:System.Net.Dns.BeginResolve(System.String,System.AsyncCallback,System.Object)"/> method.
        ///                 </param><exception cref="T:System.ArgumentNullException"><paramref name="asyncResult"/> is null.
        ///                 </exception><PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/></PermissionSet>
        [Obsolete("EndResolve is obsoleted for this type, please use EndGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
        IPHostEntry EndResolve(IAsyncResult asyncResult);

        /// <summary>
        /// The get ARPA from enum.
        /// </summary>
        /// <param name="myEnum">
        /// The enumeration.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string GetArpaFromEnum(string myEnum);

        /// <summary>
        /// The get ARPA from ip.
        /// </summary>
        /// <param name="address">
        /// The address.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string GetArpaFromIp(IPAddress address);

        /// <summary>
        /// Returns the Internet Protocol (IP) addresses for the specified host.
        /// </summary>
        /// <returns>
        /// An array of type <see cref="T:System.Net.IPAddress"/> that holds the IP addresses for the host that is specified by the
        ///     <paramref name="hostNameOrAddress"/>
        ///     parameter.
        /// </returns>
        /// <param name="hostNameOrAddress">
        /// The host name or IP address to resolve.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="hostNameOrAddress"/> is null.
        /// </exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// The length of <paramref name="hostNameOrAddress"/> is greater than 126 characters.
        /// </exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">
        /// An error is encountered when resolving <paramref name="hostNameOrAddress"/>.
        /// </exception>
        /// <exception cref="T:System.ArgumentException">
        /// <paramref name="hostNameOrAddress"/> is an invalid IP address.
        /// </exception>
        IPAddress[] GetHostAddresses(string hostNameOrAddress);

        /// <summary>
        /// The get host by address.
        /// </summary>
        /// <param name="address">
        /// The address.
        /// </param>
        /// <returns>
        /// The <see cref="IPHostEntry"/>.
        /// </returns>
        IPHostEntry GetHostByAddress(IPAddress address);

        /// <summary>
        /// Creates an <see cref="T:System.Net.IPHostEntry"/> instance from the specified <see cref="T:System.Net.IPAddress"/>.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Net.IPHostEntry"/>.
        /// </returns>
        /// <param name="address">
        /// An <see cref="T:System.Net.IPAddress"/>.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="address"/> is null.
        /// </exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">
        /// An error is encountered when resolving <paramref name="address"/>.
        /// </exception>
        /// <PermissionSet>
        ///     <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        ///     <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        ///     <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        ///     <IPermission class="System.Net.DnsPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        /// </PermissionSet>
        [Obsolete("GetHostByAddress is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
        IPHostEntry GetHostByAddress(string address);

        /// <summary>
        /// Gets the DNS information for the specified DNS host name.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Net.IPHostEntry"/> object that contains host information for the address specified in
        ///     <paramref name="hostName"/>
        ///     .
        /// </returns>
        /// <param name="hostName">
        /// The DNS name of the host.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="hostName"/> is null.
        /// </exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// The length of <paramref name="hostName"/> is greater than 126 characters.
        /// </exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">
        /// An error is encountered when resolving <paramref name="hostName"/>.
        /// </exception>
        /// <PermissionSet>
        ///     <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        ///     <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        ///     <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        ///     <IPermission class="System.Net.DnsPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        /// </PermissionSet>
        [Obsolete("GetHostByName is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
        IPHostEntry GetHostByName(string hostName);

        /// <summary>
        /// Resolves an IP address to an <see cref="T:System.Net.IPHostEntry"/> instance.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Net.IPHostEntry"/> instance that contains address information about the host specified in
        ///     <paramref name="address"/>
        ///     .
        /// </returns>
        /// <param name="address">
        /// An IP address.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="address"/> is null.
        /// </exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">
        /// An error is encountered when resolving <paramref name="address"/>.
        /// </exception>
        /// <exception cref="T:System.ArgumentException">
        /// <paramref name="address"/> is an invalid IP address.
        /// </exception>
        IPHostEntry GetHostEntry(IPAddress address);

        /// <summary>
        /// Resolves a host name or IP address to an <see cref="T:System.Net.IPHostEntry"/> instance.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Net.IPHostEntry"/> instance that contains address information about the host specified in
        ///     <paramref name="hostNameOrAddress"/>
        ///     .
        /// </returns>
        /// <param name="hostNameOrAddress">
        /// The host name or IP address to resolve.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        /// The <paramref name="hostNameOrAddress"/> parameter is null.
        /// </exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// The length of <paramref name="hostNameOrAddress"/> parameter is greater than 126 characters.
        /// </exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">
        /// An error was encountered when resolving the <paramref name="hostNameOrAddress"/> parameter.
        /// </exception>
        /// <exception cref="T:System.ArgumentException">
        /// The <paramref name="hostNameOrAddress"/> parameter is an invalid IP address.
        /// </exception>
        IPHostEntry GetHostEntry(string hostNameOrAddress);

        /// <summary>
        ///     Gets the host name of the local computer.
        /// </summary>
        /// <returns>
        ///     A string that contains the DNS host name of the local computer.
        /// </returns>
        /// <exception cref="T:System.Net.Sockets.SocketException">
        ///     An error is encountered when resolving the local host name.
        /// </exception>
        /// <PermissionSet>
        ///     <IPermission
        ///         class="System.Net.DnsPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        ///         version="1" Unrestricted="true" />
        /// </PermissionSet>
        string GetHostName();
        
        /// <summary>
        /// Queries the specified name.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="queryType">Type of the query.</param>
        /// <param name="queryClassType">Type of the query class.</param>
        /// <returns>
        /// The <see cref="Response" />.
        /// </returns>
        Response Query(string name, QType queryType, QClassType queryClassType = QClassType.IN);

        /// <summary>
        /// Resolves a DNS host name or IP address to an <see cref="T:System.Net.IPHostEntry"/> instance.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Net.IPHostEntry"/> instance that contains address information about the host specified in
        ///     <paramref name="hostName"/>
        ///     .
        /// </returns>
        /// <param name="hostName">
        /// A DNS-style host name or IP address.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="hostName"/> is null.
        /// </exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// The length of <paramref name="hostName"/> is greater than 126 characters.
        /// </exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">
        /// An error is encountered when resolving <paramref name="hostName"/>.
        /// </exception>
        /// <PermissionSet>
        ///     <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        ///     <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        ///     <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        ///     <IPermission class="System.Net.DnsPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
        /// </PermissionSet>
        [Obsolete("Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
        IPHostEntry Resolve(string hostName);

        /// <summary>
        /// Begins the get TCP request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="state">The state.</param>
        /// <returns>The <see cref="IAsyncResult"/></returns>
        IAsyncResult BeginGetTcpRequest(Request request, AsyncCallback asyncCallback, object state);

        /// <summary>
        /// Ends the get TCP request.
        /// </summary>
        /// <param name="asyncResult">The async result.</param>
        /// <returns>The <see cref="Response"/>.</returns>
        Response EndGetTcpRequest(IAsyncResult asyncResult);

        /// <summary>
        /// Begins the get UDP request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="state">The state.</param>
        /// <returns>The <see cref="IAsyncResult"/></returns>
        IAsyncResult BeginGetUdpRequest(Request request, AsyncCallback asyncCallback, object state);

        /// <summary>
        /// Ends the get UDP request.
        /// </summary>
        /// <param name="asyncResult">The async result.</param>
        /// <returns>The <see cref="Response"/>.</returns>
        Response EndGetUdpRequest(IAsyncResult asyncResult);

        #endregion
    }
}